package cc.zyjx.school.service.impl;

import java.util.List;

import cc.zyjx.school.service.ITrClassTpyeService;
import cc.zyjx.common.utils.DateUtils;
import cc.zyjx.school.domain.TrClassTpye;
import cc.zyjx.school.mapper.TrClassTpyeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 学员班级Service业务层处理
 * 
 * @author åº§å±±å®¢
 * @date 2023-05-02
 */
@Service
public class TrClassTpyeServiceImpl implements ITrClassTpyeService
{
    @Autowired
    private TrClassTpyeMapper trClassTpyeMapper;

    /**
     * 查询学员班级
     * 
     * @param id 学员班级主键
     * @return 学员班级
     */
    @Override
    public TrClassTpye selectTrClassTpyeById(Long id)
    {
        return trClassTpyeMapper.selectTrClassTpyeById(id);
    }

    /**
     * 查询学员班级列表
     * 
     * @param trClassTpye 学员班级
     * @return 学员班级
     */
    @Override
    public List<TrClassTpye> selectTrClassTpyeList(TrClassTpye trClassTpye)
    {
        System.out.println("进入了业务层  trClassTpyeMapper.selectTrClassTpyeList");
        return trClassTpyeMapper.selectTrClassTpyeList(trClassTpye);
    }

    /**
     * 新增学员班级
     * 
     * @param trClassTpye 学员班级
     * @return 结果
     */
    @Override
    public int insertTrClassTpye(TrClassTpye trClassTpye)
    {
        trClassTpye.setCreateTime(DateUtils.getNowDate());
        return trClassTpyeMapper.insertTrClassTpye(trClassTpye);
    }

    /**
     * 修改学员班级
     * 
     * @param trClassTpye 学员班级
     * @return 结果
     */
    @Override
    public int updateTrClassTpye(TrClassTpye trClassTpye)
    {
        trClassTpye.setUpdateTime(DateUtils.getNowDate());
        return trClassTpyeMapper.updateTrClassTpye(trClassTpye);
    }

    /**
     * 批量删除学员班级
     * 
     * @param ids 需要删除的学员班级主键
     * @return 结果
     */
    @Override
    public int deleteTrClassTpyeByIds(Long[] ids)
    {
        return trClassTpyeMapper.deleteTrClassTpyeByIds(ids);
    }

    /**
     * 删除学员班级信息
     * 
     * @param id 学员班级主键
     * @return 结果
     */
    @Override
    public int deleteTrClassTpyeById(Long id)
    {
        return trClassTpyeMapper.deleteTrClassTpyeById(id);
    }
}
